home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!SICE/UMAILQ
- From: "Pavel A. Zemtsov" <PZEM@sice.nsk.su>
- Newsgroups: comp.lang.c
- Subject: Floating point calculation order
- Date: Tue, 23 Jan 1996 14:14:19 -0600
- Organization: SICE Inc.
- Message-ID: <m0tedv8-0002eqC@sice.nsk.su>
- X-NNTP-Posting-Host: SICE/UMAILQ
- X-pmrqc: 1
- Priority: normal
- X-mailer: Pegasus Mail v3.1 (R1)
- X-Mail2News-Path: door.sice.ru!pion.sice.nsk.su!SICE/UMAILQ
-
-
- Having declaration
-
- double x, p, q, r;
-
- my compiler (cc on SCO 3.2) calculated following expression:
-
- x = p * q / r;
-
- as p * (q/r); (I mean, it divided first, than multiplied). That
- resulted in precision loss.
-
- Is this legal behavior?
-
- Thank you.
-
-
- Pavel A.Zemtsov pasha@sice.nsk.su
-